home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Diamond Collection
/
The Diamond Collection (Software Vault)(Digital Impact).ISO
/
cdr23
/
csmac13a.zip
/
CS-ACTON.CSM
next >
Wrap
Text File
|
1995-01-22
|
21KB
|
547 lines
┌────────────────────────────────┐
│ Chuck Seyboldt's COMMO Macro │ CS-MAC13A:CS-ACTON.CSM
└────────────────────────────────┘ Copyright (c) 1995
All rights reserved
{:|} {send ~|} {retu}
{:n} {send ~n} {retu}
{:n|} {send ~n|} {retu}
{:y|} {send ~y|} {retu}
{:loe} {send ~^[^[} {retu}
┌──────────────────────────────────┐
┌───┤ COMMO "ACTION processor" macro ├───
└──────────────────────────────────┘
*
* CS-ACTON.CSM reads simple ASCII files and sends commands and
* strings to the BBS based on the ACTION file. Setup for PCBoards.
*
* You may make an ACTION file manually with a text editor.
* An ACTION file generator is included later as the :act_alf macro command.
* Located in the COMMO home dir, the ACTION file has this sort of format:
*
*┌─────────────────────────────── action.nl ─┐
*│ u │ < "U" for upload
*│ filename.ul │ < Name the file to u/l
*│ A line of file description. Up to 45 chars │ < description
*│ in length. Multiple line descriptions are │
*│ supported if your BBS host allows them. │
*│ -- │ < "--" to end ACTION item
*│ d │ < "D" for download
*│ file1.dl │ < batch downloads allowed
*│ another.zip │
*│ filemore.lhz │
*│ -- │ < "--" is important
*│ u │
*│ another.zip │
*│ /Private to the sysop. Thanks for the fish │
*│ -- │ < Esp. at the very end.
*└─────────────────────────────────────────────┘
*
{:action}
{ifca ,off_line}
{sete-p0 act_esc}
{setv action,on} ;flag for protocol routines
{ifex %_hom%action.%abbr,,act_esc}
{rope %_hom%action.%abbr,act-end} <- START here
{:reread}
{pops-c}
{setl 60,,10,|}
{read cmd} ;read line of ACTION file
{comp cmd,--} {ifco reread} ;branch to appropriate ACTION
{comp cmd,a} {ifco asciup}
{comp cmd,j} {ifco joincn}
{comp cmd,d} {ifco dlfile}
{comp cmd,u} {ifco ulfile}
{comp cmd,z} {ifco zippy}
{comp cmd,g} {ifco g_bye} ;if no match, end ACTION
{:act-end} ;When at end of ACTION list
{exec-n echo ^j*-*-* %_dat %_tim >> %savedir\used-act.%abbr}
{exec-n type %_hom%action.%abbr >> %savedir\used-act.%abbr}
{exec-n del %_hom%action.%abbr>NUL}
{setv line} {setv fname}
{setv cmd} {setv bb}
{:act_esc} {rclo} ;Close files on abort
{setv action} ;clear "in action" flag
{goto noact,cs-logon.csm} <- END here
{:off_line}
{info-d10s0 CS-ACTON.CSM in an ON-Line macro}
{goto alm}
┌──────────────────────────────┐
│ Download processor section │
└──────────────────────────────┘
{:dlfile}
{send %cmd%|} ;Setup is for Zmodem BATCH downloads
{golo skip,not avai} ;If host doesn't allow d/l, skip it
{:next-d}{read fname} ;Read one complete line into %fname%
{inst fname,--} {ifco do-dl}
{ifex %dldir\%fname,next-d} ;Don't try to d/l files that exist
{send-n %fname% } ;Send filename to BBS
{goto next-d} ;Repeat read tip dl-list is all read
{:do-dl}{send |~~|~~|} ;Start download
{call dl_file} ;call file download subroutine
{setl 30,,10,|}
{look %bbs_pmt}
{goto reread} ;end of "D" ACTION processor
┌────────────────────────────┐
│ Upload processor section │
└────────────────────────────┘
{:ulfile}
{read fname} ;Upload ACTION starts
{ifex %uldir\%fname,,skip} ;Make sure file exists on your disk
{send-n u %fname%} ;Tell host to get ready for u/l
{send ~~|}
{golo skip,Insufficient} ; disk space for complete upload!
{golo skip,not avai} ;If host doesn't allow u/l, or
{golo skip,y exists} ;If host says file already exists,
{golo skip,plicates} ; skip this u/l action item.
{look ximum)} ;Host is ready for description.
{:desc} {read line}
{comp line,--} ;Check for end of u/l action
{ifco ul_ok}
{send-n %line%} ;Send description line
{send |}
{goto desc} ;and look for more description
{:ul_ok}{send ~|}
{call ul_file} ;call file transfer protocol
{setl 60,,30,|} ;Allow time for file validation
{push}
{golo |,remain online...} ;for upload processing OK
{look %bbs_pmt}
{goto reread} ;end of "U" ACTION processor
┌────────────────────────────┐
│ Skip to next action item │
└────────────────────────────┘
{:skip} {read line} ;SKIP section jumps to next
{comp line,--} ; action item by reading to
{ifco ,skip} ; the next "--" string.
{send |}
{setl 50,,3,|}
{look %bbs_pmt}
{goto reread} ;alternate end of "U" processor
* ASCII uploads take a special form. Here is an example message.
* You may need to structure ASCII upload messages differently.
*
*┌────────────────────────────────── hijack ──┐
*│ jack kilday │ < Message Recipient
*│ Thanks for the Fish │ < Message Subject
*│ n │ < Public/Private msg flag
*│ u │ < Use ASCII u/l, not editor
*│ Hi Jack, │
*│ │
*│ Just stopping in with a test of a COMMO │
*│ ACTION macro processor. I also wanted to │
*│ give you a big THANK YOU for all the fish. │
*│ They were delicious. │
*│ │
*│ Chuck·S │
*└─────────────────────────────────────────────┘
*
{:asciup}
{read fname} ;ASCII upload to PCBoard system
{ifex %dldir\%fname%,,reread}
{parm ,,,,2} ;Set character pacing
{send e|} ;Send "E" to start message entry
{asci %dldir\%fname%} ;Send the structured message
{parm ,,,,0} ;No character pacing
{send ~~|~~~sn|} ;the PCBoard "save" command
{look %bbs_pmt}
{goto reread} ;end of "A" processor
┌───────────────────────────┐
│ Join conference section │
└───────────────────────────┘
{:joincn}
{read fname} ;Join PCBoard Conference
{send-n j %fname} {send |}
{push}
{golo n|,)=yes?} ;Skip mail scan
{golo |,invalid} ;If you choose invalid conf
{golo n|,(H)elp} ;If you chose invalid conf
{golo 0|,none?} ;To conf 0 on invalid conf
{look %bbs_pmt} {pops}
{goto reread} ;end of "J" processor
┌──────────────────────┐
│ Zippy scan section │
└──────────────────────┘
{:zippy}
{read fname}
{clea}
{send-n z %fname a} {send |}
{capt y,%savedir\zippy.%abbr}
{exec-n echo OPENED ■ %_dat %_tim^j>> %_cap}
{push}
{golo |,more?}
{look %bbs_pmt} {pops}
{clea}
{exec-n echo CLOSED ■ %_dat %_tim^j■-■-■>> %_cap}
{capt n}
{goto reread}
┌───────────────────┐
│ Goodbye section │
└───────────────────┘
{:g_bye}{rclo}
{exec-n echo ^j*-*-* %_dat %_tim >> %savedir\used-act.%abbr}
{exec-n type %_hom%action.%abbr >> %savedir\used-act.%abbr}
{exec-n del %_hom%action.%abbr>NUL}
{setv line} {setv fname}
{setv cmd} {setv bb}
{goto byz2,cs-logon.csm}
┌───────────────────────────────────┐
└───┤ End Of "ACTION processor" macro ├───────
└───────────────────────────────────┘
┌─────────────────────────────┐
┌───┤ "ACTION generator" macro ├───
└─────────────────────────────┘
*
* This macro uses PKUNZIP to automatically insert the file
* description from a DESC.SDI or a FILE_ID.DIZ that might be
* found in a ZIP file.
*
* This macro isn't commented. It is pretty easy to follow.
{:act_alf}
{sete-p0 no_del}
{inpu abbr,Make ^(ACTION^) file: What BBS?} <- START Here
{comp abbr} {ifco do_ap}
{subs abbr,1,2,%abbr}
{:opena}{wope-a %_hom%action.%abbr}
{:icmnd}{setv cmd} {setv fname} {setv line}
{setv _menu1, D Download}
{setv _menu2, U Upload}
{setv _menu3, Z Zippy scan}
{setv _menu4, A Ascii Upload}
{setv _menu5, J Join Conf}
{setv _menu6, G Goodbye}
{setv _menu8, X eXit & Edit}
{setv _menter,e_cmnd}
{setv _mlabel,makeau,,,makedl,,,makegb,,,makejn,,,,,,,,,,,makeul,,,e_cmnd,,makezi}
{menu 12,18, Action (%abbr%) }
{:e_cmnd}
{wclo}
{setv file}
{file %_hom%action.%abbr}
{comp %_ffs,9} {ifco-l do_del} ;check for empty ACTION
{edit %_hom%action.%abbr}
{file %_hom%action.%abbr}
{comp %_ffs,9} {ifco-l ,no_del} ;check for empty ACTION
{:do_del}{exec-n del %_hom%action.%abbr>NUL} ;delete if empty
{:no_del}{setv cmd} {setv fname} {setv line}
{retu} <- END Here
{:makegb}
{writ g}
{writ --}
{goto e_cmnd}
{:makejn}
{inpu fname,Name or Number of Conference to Join}
{comp fname} {ifco icmnd}
{writ j}
{writ %fname}
{writ --} {goto icmnd}
{:makeau}
{inpu fname,Name the ASCII Upload}
{comp fname} {ifco icmnd}
{ifex %dldir\%fname,,makeau}
{writ a}
{writ %fname}
{writ --} {goto icmnd}
{:makedl}
{setv fname} {setv count,1}
{inpu fname,Name a File that you want to Download}
{comp fname} {ifco icmnd}
{writ d}
{:dlmore}
{writ %fname}
{incr count} {setv fname}
{inpu fname,File #%count% to Download?}
{comp fname} {ifco ,dlmore}
{writ --} {goto icmnd}
{:makeul}
{inpu fname,Name the File to Upload}
{comp fname} {ifco icmnd}
{ifex %uldir\%fname,descul,makeul}
{:descul}
{setv file,file_id.diz}
{exec-d %pk_un -v %uldir\%fname desc.sdi file_id.diz}
{ifer 1,,diz_dsc}
{setv count,1}
{setv line}
{inpu line,One line description of %fname% Required}
{comp line} {ifco icmnd}
{writ u} {write %fname}
{writ %line} {incr count}
{:mdesc}{setv line} {inpu line,Line %count% of %fname% description}
{comp line} {ifco endul}
{writ %line} {incr count}
{goto mdesc}
{:endul}{exec-n del %ramdr\%file>NUL}
{writ --}
{goto icmnd}
{:diz_dsc}
{writ u} {write %fname}
{:add_desc}
{exec-d %pk_un -v %uldir\%fname %file}
{ifer 1,chk_sdi}
{exec-s %pk_un -o %uldir\%fname %ramdr\ %file}
{rope %ramdr\%file,endul}
{:diz_lp}
{read line}
{writ %line}
{goto diz_lp}
{:chk_sdi}
{setv file,desc.sdi}
{goto add_desc}
{:makezi}
{inpu fname,Zippy Scan Text}
{comp fname} {ifco icmnd}
{writ z}
{writ %fname}
{writ --} {goto icmnd}
┌───────────────────────────────────┐
└───┤ End Of "ACTION generator" macro ├───────
└───────────────────────────────────┘
┌──────────────────────────────────────┐
│ File Transfer protocol subroutines │
└──────────────────────────────────────┘
* This arrangement provides a method to easily expand the file
* transfer protocols that one might use.
{:fp__z} {setv prot,z} {retu}
{:f_prot} {setv _prot,%prot} {retu}
{:or_prot}{setv _prot,%or_prot} {retu}
{:ul_file}
{comp prot} {ifco-c fp__z} ;default protocol is "Z"
{comp or_prot} ;use override protocol if defined
{ifco-c f_prot,or_prot}
{exec-n echo %uldir\%fname> %_hom%^(send^).lst}
{setl 15,um_#}
{golo uac_s,^xSMODEM}
{golo uac_k,^a# N3}
{golo uac_z,^xB01}
{look File upload protocol} {}
{:uac_s} {setv _prot,s} {goto um_#} ;protocol macros in CS-COMMO.CSM
{:uac_k} {setv _prot,k} {goto um_#}
{:uac_z} {setv _prot,z} {goto um_#}
{:dl_file}
{comp prot} {ifco-c fp__z} ;default protocol is "Z"
{comp or_prot} ;use override protocol if defined
{ifco-c f_prot,or_prot}
{setl 15,dm_#}
{sslo ss_r,tinue? ( )} ;batch download prompt
{golo reread,%bbs_pmt} ;if no filenames matched
{golo dac_s,^xSMODEM} ;host action can over-ride
{golo dac_k,^a5 S~} ; mistaken protocol at CS-COMMO
{golo dac_z,^xB00}
{look File download protocol} {}
{:dac_s} {setv _prot,s} {goto dm_#} ;protocol macros in CS-COMMO.CSM
{:dac_k} {setv _prot,k} {goto dm_#}
{:dac_z} {setv _prot,z} {goto dm_#}
┌────────────────────────────────┐
│ Chuck Seyboldt's COMMO Macro │ CS-MAC13A:CS-INET
└────────────────────────────────┘ Copyright (c) 1995
*
* This macro is used to access internet directories for telnet,
* finger, and ftp purposes.
* It contains the VT102 key set.
* File transfer initiation can use auto-start strings or Alt-Z
{:trying} {setv _dialsr,%_dialsr,Trying} {retu}
{:sq_lb} {setv _dialsr,%_dialsr,[} {retu}
{:connect}{setv _dialsr,%_dialsr,CONNECT}{retu}
{:start_in}
{noca a_unlo}
{setv fon,%_fon} ;Save .FON name
{inst %_dialsr,Trying} {ifco-c ,trying} ;dial success response
{inst %_dialsr,[} {ifco-c ,sq_lb} ;additions
{inst %_dialsr,CONNECT}{ifco-c ,connect}
{setv dialpf,%_dialpf} ;Save dial prefix
{setv dialsf,%_dialsf} ;Save dial suffix
{setv _dialsf,|}
{inst _ela,:}
{setv pos,%_pos}{decr pos}
{subs min,1,%pos,%_ela} ;initialize elapsed timer
{subs sec,-2,2,%_ela}
{:nfb} {setv _menu1, F ■ Ftp} _dialsr=Connected
{setv _menu2, N ■ fiNger} _dialsr≈[blah.blah.blah]
{setv _menu3, T ■ Telnet} _dialsr=Trying
{setv _menu4, U ■ Unload}
{setv _menter,a_unlo}
{setv _mlabel,,,,,,in_mf,,,,,,,,in_mn,,,,,,in_mt,a_unlo}
{menu 8,13,internet}
{}
{:in_mf}
{fonf ftp.adr}
{setv _dialpf,ftp }
{goto in_dial}
{:in_mn}
{fonf finger.adr}
{setv _dialpf,finger }
{goto in_dial}
{:in_mt}
{fonf telnet.adr}
{setv _dialpf,telnet }
{goto in_dial}
{:ald}
{:in_dial}
{setv ad}
{setv cd}
{setv _pas}
{setv login}
{inst _ela,:} {setv pos,%_pos} {decr pos}
{subs e_min,1,%pos,%_ela} {incr min,%e_min} ;update %min & %sec
{subs e_sec,-2,2,%_ela} {incr sec,%e_sec}
{divi sec,60}
{incr min,%sec} {setv sec,%_rem} ;%min & %sec hold
{dial} {} ; time between dials
{:padsec} {setv d_sec,0%d_sec} {retu}
{:alt} {setv d_min,%min} {setv d_sec,%sec} ;%d_xxx = Cum online
{inst _ela,:} {setv pos,%_pos} {decr pos}
{subs e_min,1,%pos,%_ela} {incr d_min,%e_min} ;update Cum time each
{subs e_sec,-2,2,%_ela} {incr d_sec,%e_sec} ; time Alt-T is called
{divi d_sec,60}
{incr d_min,%d_sec} {setv d_sec,%_rem}
{leng %d_sec}{comp _len,2} {ifco-lc padsec}
{setv ela,%d_min%:%d_sec} ;%ela is Cum online
{info-d5s0 %ela Total / %_ela at %_nam} {}
{:nfa}
{setv _menu1, 1 ■ Login=%login
{setv _menu2, 2 ■ Pass=%_pas
{setv _menu3, 3 ■ Ad=%ad
{setv _menu4, 4 ■ Cd=%cd
{setv _menu5, 5 ■ Unload
{setv _mlabel,in_a,in_b,in_c,in_d,a_unlo}
{menu 9,30,%_num}
{}
{:in_a} {send ~~%login|} {}
{:in_b} {send ~~%_pas|} {}
{:in_c} {send ~~%ad|} {}
{:in_d} {send ~~%cd|} {}
{:a_unlo}{call restore} {unlo}
{:restore}
{fonf %fon} {setv fon}
{setv _dialpf,%dialpf} {setv dialpf}
{setv _dialsf,%dialsf} {setv dialsf}
{setv login}
{setv ad}
{setv cd}
{retu}
┌──────────────────────┐
│ COMMO.SET defaults │
└──────────────────────┘
* Edit this to your COMMO.SET default values. When things get
* messed-up, this makes recovery simpler
{:cf1} {fonf commo.fon}
{setv _dialpf,AT&M4&K0M0DT }
{setv _dialsf,|}
{setv _dialsr,CONNECT}
{unlo}
┌──────────────────┐
│ Logon Macros │
└──────────────────┘
{:xyz} {}
┌──────────────────┐
│ VT102 Macro File │
└──────────────────┘
IMPORTANT! The PgUp and PgDn keys are part of VT102 emulation. To see the
upload or download menus, press Alt-Z (File Transfer Menu).
See Appendix E for information about the key assignments and how to use this
file.
───────────────────────────────────────────────────────────────────────────
{:hom} {send ^[[H} {} Home
{:chm} {send ^[[L} {} ^Home
{:pgu} {send ^[[Or} {} PgUp
{:cpu} {send ^[[M} {} ^PgUp
{:pgd} {send ^[[Oq} {} PgDn
{:cpd} {send ^[[H^[[2J} {} ^PgDn
{:end} {send ^[[K} {} End
{:upa} {vtcur ^[[A|^[OA} {} Up Arrow
{:dna} {vtcur ^[[B|^[OB} {} Down Arrow
{:lfa} {vtcur ^[[D|^[OD} {} Left Arrow
{:rta} {vtcur ^[[C|^[OC} {} Right Arrow
{:ins} {send ^[On} {} Insert
{:del} {send } {} Delete
{:bsp} {send ^H} {} Backspace
{:cbs} {send } {} ^Backspace
{:nf1} {send ^[OP} {} F1 (PF1)
{:nf2} {send ^[OQ} {} F2 (PF2)
{:nf3} {send ^[OR} {} F3 (PF3)
{:nf4} {send ^[OS} {} F4 (PF4)
{:kp0} {vtpad 0|^[Op} {} Keypad 0
{:kp1} {vtpad 1|^[Oq} {} Keypad 1
{:kp2} {vtpad 2|^[Or} {} Keypad 2
{:kp3} {vtpad 3|^[Os} {} Keypad 3
{:kp4} {vtpad 4|^[Ot} {} Keypad 4
{:kp5} {vtpad 5|^[Ou} {} Keypad 5
{:kp6} {vtpad 6|^[Ov} {} Keypad 6
{:kp7} {vtpad 7|^[Ow} {} Keypad 7
{:kp8} {vtpad 8|^[Ox} {} Keypad 8
{:kp9} {vtpad 9|^[Oy} {} Keypad 9
{:kp.} {vtpad .|^[On} {} Keypad .
{:gr*} {vtpad ,|^[Ol} {} Keypad ,
{:gr-} {vtpad -|^[Om} {} Keypad -
{:gr+} {vtpad %_ent|^[OM} {} Keypad Enter
Macro for File Transfers (press Alt-Z)
────────────────────────────────────────────────────────────────────────────
{:alz}
{setv _menu1, D ≡ Download menu}
{setv _menu3, U ≡ Upload menu}
{setv _mlabel,,,,mpd,,,,,,,,,,,,,,,,,mpu}
{setv _mcolor,%menu_clr}
{menu 7,20,Utility Menu} {}
- end -